{% import "TopxiaWebBundle::macro.html.twig" as web_macro %}
{% set quality = "" %}

<tr id="upload-file-tr-{{uploadFile.id}}" data-role="item" data-convertHash="{{uploadFile.convertHash}}">

  <td><input value="{{uploadFile.id}}" type="checkbox" data-role="batch-item" ></td>

  <td>
    {% if uploadFile.storage == 'cloud' %}
      <span class="glyphicon glyphicon-cloud text-muted" title="{{'云文件'|trans}}"></span>
    {% endif %}

    <a href="{{ path('course_manage_file_show', {id:course.id, fileId:uploadFile.id}) }}" target="_blank" rel="tooltip" title data-original-title="{{ uploadFile.filename }}"  >{{ uploadFile.filename|sub_text(30) }}
    </a>
    
    {% if setting('developer.debug') and uploadFile.storage == 'cloud' and uploadFile.type in ['video', 'ppt', 'document'] %}
      <a href="javascript:;" data-url="{{ path('course_manage_file_convert', {id:course.id, fileId:uploadFile.id}) }}" class="convert-file-btn text-danger">{{'重新转换(调试模式)'|trans}}</a>
    {% endif %}
    <br>

  </td>
  <td>
    {{ dict_text('fileType', uploadFile.type) }}
  </td>
  <td>{{ web_macro.bytesToSize(uploadFile.fileSize) }}</td>
  <td>
    {% set fileQuotes = filesQuote[uploadFile.id]|default(null) %}
    {% if 'courselesson' in fileQuotes %}
      <span class="label label-success tip">{{'课时'|trans}}</span>
    {% endif %}
    {% if 'coursematerial' in fileQuotes %}
      <span class="label label-info tip">{{'资料'|trans}}</span>
    {% endif %}
  </td>
  <td>
    <span class="text-sm">{{ web_macro.user_link(users[uploadFile.updatedUserId]|default(null)) }}</span>
    <br>
    <span class="text-muted text-sm">
      {% if not uploadFile.updatedTime %}
        {{ uploadFile.createdTime|date('Y-n-d H:i')}}
      {% else %}
        {{ uploadFile.updatedTime|date('Y-n-d H:i')}}
      {% endif %}
    </span>
  </td>

</tr>
